acpi: set correct address of the control/event blocks in the FADT
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 29 Aug 2017 08:50:24 +0000 (09:50 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 29 Aug 2017 09:42:16 +0000 (10:42 +0100)
commita8c87a8788e5ce21d6e55e0acdc64a8f26cf5687
tree9b4d8d5542646c1ef605de19918e475e85d5eb80
parent4b6923acff662dd06a29f10c94cc2d3a360139f3
acpi: set correct address of the control/event blocks in the FADT

Commit 149c6b unmasked an issue long present in Xen: the control/event
block addresses provided in the ACPI FADT table where hardcoded to the
V1 version. This was papered over because hvmloader would also always
set HVM_PARAM_ACPI_IOPORTS_LOCATION to 1 regardless of the BIOS
version.

The most notable issue caused by the above bug was that the QEMU
traditional GPE0 block was out of sync: the address provided in the
FADT didn't match the address QEMU was using.

Note that PM1a and TMR worked fine because the V1 address was
hardcoded in the FADT and HVM_PARAM_ACPI_IOPORTS_LOCATION was
unconditionally set to 1 by hvmloader.

Fix this by passing the address of the control/event blocks to
acpi_build_tables, so the values can be properly set in the FADT table
provided to the guest.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/firmware/hvmloader/ovmf.c
tools/firmware/hvmloader/rombios.c
tools/firmware/hvmloader/seabios.c
tools/firmware/hvmloader/util.c
tools/libacpi/build.c
tools/libacpi/libacpi.h